package com.space.user.assembler;

import com.space.client.dto.UserInfoDTO;
import com.space.user.converter.ShareMapperConfig;
import com.space.user.domain.info.entity.UserInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author <a href="mailto:414563035@qq.com">Bedroom</a>
 * @date 2021/4/15 3:39 下午
 */
@Mapper(config = ShareMapperConfig.class)
public interface UserInfoAssembler {
    @Mappings({
            @Mapping(source = "userId.userId", target = "userId"),
            @Mapping(source = "nickname.nickname", target = "nickname"),
            @Mapping(source = "phoneNumber.phoneNumber", target = "phoneNumber"),
            @Mapping(source = "account.balance", target = "balance")
    })
    UserInfoDTO toUserInfoDTO(UserInfo userInfo);
}
